<div class="pageContent">
    <form method="post" id="updateDefectNodeFrom" action="${rc.getContextPath()}/manage/defectNode/modifyDefectNode" class="pageForm required-validate" onsubmit="return validateCallback(this, navTabAjaxDone)">
        <input type="hidden" name="navTabId" value="${navTabId!''}" />
        <div class="pageFormContent nowrap" layoutH="58">
            <fieldset>
                <dl>
                    <dt><@label key="code.C,colon">编码：</@label></dt>
                    <dd>
                        <input name="nodeCode"  value="${defectNode.nodeCode!''}" size="32" type="text" maxlength="20" class="required alphanumeric toUp"/>
                    </dd>
                </dl>
                <dl>
                    <dt><@label key="description.C,colon">描述：</@label></dt>
                    <dd>
                        <input name="nodeText"  value="<#if (defectNode.nodeText)??>${defectNode.nodeText!''}</#if>" size="32" maxlength="60" type="text" />
                    </dd>
                </dl>
                <dl>
                    <dt><@label key="parentNode.C,colon">父节点：</@label></dt>
                    <dd>
                        <input  name="parentNodeCode" readonly value="<#if (parentDefectNode)??>${parentDefectNode.nodeCode!''}</#if>" size="32" type="text"/>
                        <input type="text" readonly  value="<#if (parentDefectNode)??>${parentDefectNode.nodeText!''}</#if>" />
                    </dd>
                </dl>
                <dl>
                    <dt><@label key="type.C,colon">类型：</@label></dt>
                    <dd>
                        <select name="nodeTypeeCode" class="required" disabled="disabled">                
                            <option value=""><@label key='selected_first.C'>请选择</@label></option>
                            <#if defectNodeTypes??>
                                <#list defectNodeTypes as defectNodeType>
                                    <option value="${defectNodeType.eCode!''}" <#if defectNode.nodeTypeeCode==defectNodeType.eCode>selected</#if> >${defectNodeType.eCodeText!''}</option>
                                </#list>
                            </#if>
                        </select>
                    </dd>
                </dl>
                <dl class='notnormal' id="defectDefine_lookUp">
                    <dt><@label key="defectDefine.C,colon">缺陷：</@label></dt>
                    <dd>
                        <input id="defectLookup.defectCode" name="defectCode" type="hidden" value="${defectNode.defectCode!''}"/>
                        <input class="look" id="defectLookup.defectText" name="defectText" type="text" postField="suggestTest" suggestFields="defectCode,defectText" 
                        suggestUrl="${rc.getContextPath()}/manage/defect/defectSuggest" lookupGroup="defectLookup" value="${defectNode.defectText!''}"/>
                        <a class="btnLook" href="${rc.getContextPath()}/manage/defect/defectLookUp?lookupType=radio" rel="defectLookup_dialog" title="<@label key='select.C,defectDefine.C'>选择缺陷</@label>" lookupGroup="defectLookup" ></a>
                    </dd>
                </dl>
                <!-- <dl>
                    <dt><@label key="lockFlag.C,colon">锁定标记：</@label></dt>
                    <dd>
                        <label><input style="margin-right: 2px;" type="checkbox" name="lockFlag" value="1"<#if (defectNode.lockFlag)?? && (defectNode.lockFlag == 1)> checked="true"</#if>><@label key="lock.C">锁定</@label></label>
                    </dd>
                </dl> -->
                <dl>
                    <dt>&nbsp;</dt>
                    <dd id="defectNode_button">
                        <div class="buttonActive">
                            <div class="buttonContent">
                                <button type="submit"><@label key="save.B">保存</@label></button>
                            </div>
                        </div>
                        <div class="buttonActiveGrey">
                            <div class="buttonContent">
                                <button type="button" onclick="_defectNodeCancel();"><@label key="cancel.B">取消</@label></button>
                            </div>
                        </div>
                    </dd>
                </dl>
            </fieldset>
        </div>
        <#if defectNode??> <#assign createInfo = defectNode/> 
                        <#include "/common/createInfo.html"> </#if>            
        </div>
    </form>
</div>

<script type="text/javascript">
    $(function(){
        $("select[name='nodeTypeeCode']", navTab.getCurrentPanel()).change(function(){
            var options = $(this).val();
            if(options && options == 'ITEM'){
                $("dl#defectDefine_lookUp").show();
                $("input#defectLookup\\.defectText").addClass("required");
            }else{
                $("dl#defectDefine_lookUp").hide();
                $("input#defectLookup\\.defectText").removeClass("required");
            }
        })
        <#if defectNode?? && defectNode.nodeTypeeCode == "ITEM">$("dl#defectDefine_lookUp").show();<#else>$("dl#defectDefine_lookUp").hide();</#if>
    })
    
    function _toViewDefectNode(_nodeCode) {
        if(_nodeCode){
            $("div#defectNode_detail", navTab.getCurrentPanel()).loadUrl(hostUrl+"/defectNode/viewDefectNode", {nodeCode:_nodeCode, navTabId:'${navTabId!''}'});
        }
    }
    
</script>